package com.itheima;

/**
 * 2025/4/18 20:56
 */
public class TestCard {
    public static void main(String[] args) {
        double money = 1000;//消费的金额
        Card goldCard = new GoldCard("川A888888", "张三", "123456789", 6000);
        goldCard.charge(5000);
        boolean pay = goldCard.pay(money);
        if (pay && money >= 200) {
            //判断goldCard是否是GoldCard
            if (goldCard instanceof GoldCard) {
                GoldCard gk = (GoldCard) goldCard;
                gk.washCar();
            }
        }

        Card silverCard = new SilverCard("川A99999", "李四", "99999999999", 2000);
        silverCard.charge(2000);
        boolean pay2 = silverCard.pay(3000);
        if (pay2){
            System.out.println("支付成功");
        }else {
            System.out.println("支付失败");
        }


    }
}
